package com.yanqu.road.entity.activity.daomu.enums;

public enum DaoMuNpcShowTypeEnum {

    NPC_SHOW_TYPE_RANDOM(1, "全局随机", false),

    NPC_SHOW_TYPE_FOUR_ANGLE(2, "四角随机", true),

    NPC_SHOW_TYPE_CIRCLE(3, "主角周围一圈", false);

    /**
     * 类型
     */
    private int type;

    /**
     * 名称
     */
    private String name;

    /**
     * 是否清除该出现方式的怪
     */
    private boolean clearFlag;

    DaoMuNpcShowTypeEnum(int type, String name, boolean clearFlag) {
        this.type = type;
        this.name = name;
        this.clearFlag = clearFlag;
    }

    public int getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public boolean isClearFlag() {
        return clearFlag;
    }

    /**
     * 检测是否可自动清除
     * @param type
     * @return
     */
    public static boolean checkClear(int type) {
        for (DaoMuNpcShowTypeEnum showTypeEnum : DaoMuNpcShowTypeEnum.values()) {
            if (type == showTypeEnum.getType()) {
                return showTypeEnum.isClearFlag();
            }
        }
        return false;
    }
}
